import ajax from '@/api/ajax'

// 获取地址信息
export const reqAddress = geohash => ajax('/api/position/' + geohash)

// 获取食品分类信息
export const reqCategorys = () => ajax('/api/index_category')

// 获取商品列表
export const reqShops = ({latitude, longitude}) => ajax('/api/shops', {latitude, longitude})

// 帐号密码登录
export const reqPwdLogin = (name, pwd, captcha) => ajax('/api/login_pwd', {name, pwd, captcha}, 'POST')

// 获取短信验证码
export const reqSendCode = phone => ajax('/api/sendcode', {phone})

// 手机号验证码登录
export const reqSmsLogin = (phone, code) => ajax('/api/login_sms', {phone, code}, 'POST')

// 获取用户信息 ( 根据会话 )
export const reqUserInfo = () => ajax('/api/userinfo')

// 请求登出
export const reqLogout = () => ajax('/api/logout')

// 获取商家信息
export const reqShopInfo = () => ajax('/shop_info')

// 获取商家评价数组
export const reqShopRatings = () => ajax('/shop_ratings')

// 获取商家商品数组
export const reqShopGoods = () => ajax('/shop_goods')
